const {User} = require("../../models/User");

module.exports = async (req, res) => {
    try{
        var {followId, user_id} = req.body
        const update1 = await User.updateOne({user_id:user_id},
        {$pull:{"follows":{"user_id": followId}}});
        User.updateOne({user_id:followId},
        {$pull:{"fans":{"user_id": user_id}}})
        res.send({errCode:"1",msg:"取消关注成功"})
    }catch(e){
        res.status(400).send({errCode:"1",msg:"请求错误"})
    }
}